#pragma once
#ifndef __G_APPLICATION_H__
#define __G_APPLICATION_H__

#include <string>
#include <vector>

#include "GCore.h"
#include "GModule.h"
#include "GWindow.h"

namespace GEngine
{
	class GApplication : public GModule
	{
	G_MODULE(GApplication);

	friend class GCore;

	typedef std::vector<GWindow*>	WindowArray;

	protected:
		void*			Handle;

		GWindow*		MainWindow;
		WindowArray		Windows;

						GApplication();
		virtual			~GApplication();

	public:
		void*			GetHandle() const;
		const char*		GetAppName() const;

		void			AppendWindow(GWindow* Window);
		void			RemoveWindow(GWindow* Window);

		GSize			GetWindowCount() const;
		GWindow*		GetWindowByIndex(GSize Index) const;
		GWindow*		FindWindowByHandle(void* Handle);

		virtual bool	Initialize() OVERRIDE;
		virtual void	Uninitialize() OVERRIDE;

	};

}

#endif